<style>
        .header {
            margin-bottom: 10px;
        }

        .sample-item .row-fluid > div > label:first-child {
            font-weight: bold;
        }

        .sample-item .row-fluid > div {
            margin-bottom: 10px;
        }

        .sample-item {
            border-bottom: 1px solid #e2e2e2;
            padding: 20px 0;
        }

            .sample-item:last-child {
                border-bottom: none;
                padding-bottom: 0;
            }

            .sample-item .btn-glow {
                margin-left: 15px;
            }

            .sample-item .ui-select {
                height: 32px;
            }

                .sample-item .ui-select select {
                    height: 30px; 
                }
</style>
<div id="pad-wrapper" class="new-user">
	<div class="row-fluid header">
		<h3>样本信息</h3>
	</div>
	<div class="row-fluid form-wrapper">
		<!-- left column -->
		<div class="span9 with-sidebar">
			<div class="container">
					<?php foreach ($bind_list as $key=>$row):?>
					<div class="sample-item">
		                <div class="row-fluid">
		                    <div class="span3">
		                        <label>样本编号:</label>
		                        <label><?php echo $row['bind_no']?></label>
		                    </div>
		                    <div class="span3">
		                        <label>姓名:</label>
		                        <label><?php echo $row['name']?></label>
		                    </div>
		                    <div class="span3">
		                        <label>性别:</label>
		                        <label><?php if($row['sex'] == 1):?>男<?php else :?>女<?php endif;?></label>
		                    </div>
		                    <div class="span3">
		                        <label>电话:</label>
		                        <label><?php echo $row['mobile']?></label>
		                    </div>
		                </div>
		                <div class="row-fluid">
		                    <div class="span12">
		                        <label>对应报告结果:</label>
		                        <div class="ui-select span2">
		                            <select name="report_result_id" id="select_<?php echo $key?>">
		                                <option value="0">--请选择--</option>
										<?php if($result_list):?>
										<?php foreach ($result_list as $result):?>
										<option value="<?php echo $result['report_result_id']?>" <?php if($result['report_result_id'] == $row['template_id']):?> selected <?php endif;?>><?php echo $result['description']?></option>
										<?php endforeach;?>
										<?php endif;?>
		                            </select>
		                        </div>
		                        <input type="button" class="btn-glow primary" value="绑定样本" onclick="bindBtn(<?php echo $key?>, <?php echo $row['bind_id']?>)">
		                    </div>
		                </div>
		           </div>
				<?php endforeach;?>
			</div>
		</div>
		<!-- side right column -->
		<div class="span3 form-sidebar pull-right">
		</div>
	</div>
</div>
<script>
function bindBtn(id, bindId)
{
	var select = $("#select_"+id);
	var selectId = select.val();
	if(selectId == 0)
	{
		alert("请选择绑定的样本类型");
		return false;
	}
	else
	{
		//ajax更新数据
		$.ajax({
				url: "/order/save",
				type: "post",
				data:{bind_id: bindId, result_id: selectId},
				success: function(msg)
				{
					alert(msg);
				}
			});
	}
	
}
</script>